#ifndef LabTool_H_
#define LabTool_H_

#include "OCMain/StringUtil.h"
#include "OCMain/StringConverter.h"
#include "OCMain/Log.h"
#include "OCMain/SimpleIni.h"

using namespace OCPP;
#define OCPP_QString(s) A2U8(s).c_str()
#define OCPP_QToString(s) s.toStdString()

#include <QtWidgets>

class LabTool : public QObject
{
public:
	LabTool();
	~LabTool();
	QMap<QString, QWidget*> tools;

	QString getConfig(String sect, String key, QString defalutValue = tr(""));
	int getIntConfig(String sect, String key, int defalutValue = 0);
	void setConfig(String sect, String key, QString value);
	void setIntConfig(String sect, String key, int value);
	static LabTool& instance();
	CSimpleIniA mConfig;
};

#define GetLabConfig(key,value) LabTool::instance().getConfig(ConfigSect,key,value)
#define SetLabConfig(key,value) LabTool::instance().setConfig(ConfigSect,key,value)
#define GetLabConfigInt(key,value) LabTool::instance().getIntConfig(ConfigSect,key,value)
#define SetLabConfigInt(key,value) LabTool::instance().setIntConfig(ConfigSect,key,value)


#endif // !LabTool_H_
